package com.itheima.features.collections;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

public class CollectionsDemo01 {

    public static void main(String[] args) {

        ArrayList<String> stringArrayList = new ArrayList<>();
        stringArrayList.add("聂明玦");
        stringArrayList.add("聂怀桑");
        stringArrayList.add("不净世");

        Collection<String> stringCollection = Collections.unmodifiableCollection(stringArrayList);

//        stringCollection.add("清河");
        stringCollection.remove("聂明玦");

        stringCollection.forEach(s -> System.out.println(s));
    }
}
